package com.thyme.system.controller;

import com.thyme.system.service.Iec61850IedInstService;
import com.thyme.system.vo.Iec61850IedInstVo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author thyme
 * @ClassName MenuController
 * @Description TODO
 * @Date 2019/12/30 15:03
 */
@Controller
@RequestMapping("/ICDImportConfig")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ICDImportConfigController {
    private final Iec61850IedInstService iec61850IedInstService;

    @GetMapping("/list")
    public String index(){
        return "module/ICDImportConfig/config";
    }
    @GetMapping("/node/list")
    public String node(){
        return "module/ICDImportConfig/node";
    }

    @GetMapping("/update")
    public String update(Integer id, Model model){
        Iec61850IedInstVo iec61850IedInstVo = iec61850IedInstService.getById(id);
        model.addAttribute("iec61850IedInstVo",iec61850IedInstVo);
        return "module/ICDImportConfig/updateConfig";
    }
}
